using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ns
{
    ///<summary>
    ///
    ///</summary>
    public class Sprite : MonoBehaviour
    {
        public Material material;
        public Transform cameraTransform;

        void Start()
        {
            material = GetComponent<Renderer>().material;
            cameraTransform = Camera.main.transform;
        }

        void Update()
        {
            material.SetTextureOffset("_MainTex", new Vector2(0,- cameraTransform.position.y / 20));
        }
    }
}
